<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>for...in遍历对象的属性</title>
    <script>
        var books = new Array()
        books[0] = '《JavaScript前端开发案例教程》'
        books[1] = '《Node.js核心基础教程》'
        books[2] = '《HTML5移动Web开发》'
        for (book in books) {
            if (books.hasOwnProperty(book)) {
                document.write(books[book] + '<br>');

            }
        }
    </script>
</head>

<body>

</body>

</html>